package com.jxnu.duewang.zmly;

import android.content.Intent;
import android.content.SharedPreferences;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

import com.jxnu.duewang.zmly.zmly.adapter.IntroducePictureAdapter;
import com.jxnu.duewang.zmly.zmly.model.IntroduceImageLastEvent;

import java.util.ArrayList;

public class IntroduceActivity extends AppCompatActivity implements IntroduceImageLastEvent {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_introduce);
        ViewPager pager = (ViewPager) findViewById(R.id.introduce_pager);
        ArrayList<String> imageResourceUrls = getIntent().getStringArrayListExtra("urlList");
        IntroducePictureAdapter adapter = new IntroducePictureAdapter(this, imageResourceUrls,this);
        pager.setAdapter(adapter);
    }

    @Override
    public void clickButton(View view) {
        SharedPreferences mZmly = getSharedPreferences("zmly", MODE_PRIVATE);
        SharedPreferences.Editor edit = mZmly.edit();
        edit.putBoolean("rememberpass",false);
        edit.apply();
        startActivity(new Intent(this,MainActivity.class));
        overridePendingTransition(android.R.anim.fade_in,android.R.anim.fade_out);
        finish();
    }
}
